package org.micode.demo.db.service.impl;

import org.micode.demo.db.dao.SysUserRoleDao;
import org.micode.demo.db.domain.dto.SysUserRoleDTO;
import org.micode.demo.db.domain.entity.SysUserRoleDO;
import org.micode.demo.db.domain.query.SysUserRoleQuery;
import org.micode.demo.db.service.DaoSysUserRoleService;
import org.micode.libs.dao.base.BaseAllServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户所属角色(sys_user_role) 服务实现类
 *
 * author: wutianbin
 */
@Service
@Slf4j
public class DaoSysUserRoleServiceImpl
        extends BaseAllServiceImpl<Long, SysUserRoleDTO, SysUserRoleDO, SysUserRoleQuery, SysUserRoleDao>
        implements DaoSysUserRoleService {

    @Autowired
    private SysUserRoleDao sysUserRoleDao;

    @Override
    protected SysUserRoleDao getMyDao() {
        return sysUserRoleDao;
    }

    @Override
    public List<Long> queryRoleIdList(Long userId) {
        return sysUserRoleDao.listRoleIdByUser(userId);
    }

}
